import requests

def test_post_request():
    url = "http://localhost:5001/receive_data"  # 确保端口和路径正确
    data = {'key': 'value'}  # 发送的测试数据
    try:
        response = requests.post(url, data=data)
        print("状态码:", response.status_code)
        print("响应体:", response.text)
    except Exception as e:
        print("发生错误:", e)

if __name__ == "__main__":
    test_post_request()
